package com.grm.sys.controller;

import com.grm.common.entity.Result;
import com.grm.sys.request.login.LoginRequest;
import com.grm.sys.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginRequest loginRequest){
        String token = loginService.login(loginRequest);
        return Result.success(token);
    }
}
